 <% provide(:title, "Your Cart") %> 
 <div class="span9">
  <h3 class="header-title"><%=(t "ordercart.title")%></h3>
  <div class="popover-content">
    <% if @cart.empty? %>
    <p><%=(t "ordercart.empty")%></p>
    <% end %>

    <% total = 0 %>
    <table class="table cart" id="yourcart">
      <tr>
        <th></th>
        <th><%=(t "ordercart.item")%></th>
        <th><%=(t "ordercart.price")%></th>
        <th><%=(t "ordercart.quantity")%></th>
        <th><%=(t "ordercart.total")%></th>
        <th></th>
      </tr>

      <% @cart.each do | id, quantity | %>
      <% item = Products.find_by_id(id) %>
      <tr>
        <td>
          <div class="image">
            <%= link_to (image_tag item.imageurl), item %>
          </div>
        </td>
        <td><%= link_to item.name, item %></td>
        <td><%= number_to_currency(item.price, :unit => "") %> <%= item.currency %></td>
        <td><%= quantity %><br /></td>
        <td><b>
          <%= number_to_currency(quantity * item.price, :unit => "") %> <%=item.currency%></b>
        </td>
        <td><b>
          <a href="javascript:void(0)" onCLick="DeleteCart(<%= item.id %>)"><%=(t "ordercart.btndelete")%></a></b>
        </td>
      </tr>
      <% total += quantity * item.price %>
      <% end %>

      <tr>
        <td colspan="4">
          <div class="total"><%=(t "ordercart.total")%>:</div>
        </td>
        <td>
          <div class="price"><%= number_to_currency(total, :unit => "") %> $</div>
        </td>
      </tr>
    </table>
    <% if !@cart.empty? %>
    <div align="center" id="btnCheckout">
      <a href="<%= checkout_path %>"><button class="btn btn-success" type="button"><%=(t "ordercart.btncheckout")%></button></a>
      <button class="btn btn-success" type="button" onClick="UnsetCart()"><%=(t "ordercart.btndeleteall")%></button>
    </div>
    <% end %>
  </div>
  <div style="clear:both"></div>
</div>